<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="computerRoomList" checkbox="false" fitColumns="true" title="预约记录" actionUrl="expResultController.do?listDatagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="申请人"  field="applyUser"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="createDate"  field="createDate" hidden="true" formatter="yyyy-MM-dd" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="expReportAttach"  field="expReportAttach" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="deviceId"  field="deviceId" hidden="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="hasSendMsg"  field="hasSendMsg" hidden="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="状态值"  field="applyStateValue"  hidden="true"  queryMode="single" width="80" ></t:dgCol> 
   <t:dgCol title="computerRoom"  field="computerRoom.id"  hidden="true"  queryMode="single" width="80" ></t:dgCol> 
   
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="实验室名称"  field="computerRoom.name" queryMode="single"  width="120"></t:dgCol>   
   <t:dgCol title="机床"  field="device.machineName" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="机床负责教师"  field="device.teacher.realName" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="预约开始日期"  field="applyDate" formatter="yyyy-MM-dd hh:mm" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="预约结束日期"  field="applyEndDate" formatter="yyyy-MM-dd hh:mm"  queryMode="single"  width="120"></t:dgCol>   
   <t:dgCol title="状态"  field="isChecked"   formatterjs="function(v,rec){return v==0?'未批阅':'已批阅'}" 
    queryMode="single"  width="120" replace="未批阅_0,已批阅_1" query="true"></t:dgCol>
   <t:dgCol title="分数"  field="score"   queryMode="single"  width="60"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="130"></t:dgCol>
   <t:dgFunOpt  funname="uploadRpt(id)" title="上传作业" /> 
   <t:dgFunOpt  funname="downloadAtta(id)" title="下载作业" exp="expReportAttach#empty#false"/>   
  </t:datagrid>
  </div>
 </div> 		
 <script type="text/javascript">

 function downloadAtta(id){
	window.location.href="cms-attach.do?download&ownerId="+id;
 }

 
 function uploadRpt(id){	 
		 $.dialog({
		  	id:'xxx',
			content: 'url:expResultController.do?showUpload&id='+id,
			lock : true,
			zIndex: getzIndex(), 
			parent:frameElement.api,
			width:480,
			height:350,
			title:'上传实验作业', 
			opacity : 0.3,
			cache:false,
		    ok: function(){
		    	var iframe = this.iframe.contentWindow;
		    	var len = $('input[name=attachId]',iframe.document).length;
		    	if(len == 0){
		    		tip('请选择实验作业');
		    		return false;
		    	}
		    	$('#btn_sub', iframe.document).click();
		    	return false;
		    },
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
	});
	}
 </script>